import random
with open('软件1804.txt','r') as f:
    sn = f.readlines()

with open('学校名单.txt','r') as f:
    cn = f.readlines()

with open('考试名单.csv','w') as f:
    ls =[]
    for n in sn:
        ls.append(n.replace('\n',''))
        ls.append(cn[random.randint(0,len(cn)-1)].replace('\n', ''))
        f.write(','.join(ls)+'\n')
        ls =[]

